package bizlogic;

import java.util.ArrayList;

import model.LeaveTypeDTO;
import model.PositionDTO;
import exception.DAOSystemException;
import dao.DAOFactory;
import dao.LeaveTypeDAO;

public class LeaveTypeManager {
	private LeaveTypeDAO leaveTypeDAO;
	public LeaveTypeManager() {
		leaveTypeDAO = DAOFactory.loadInstance().getLeaveTypeDAO();
	}

	@SuppressWarnings("finally")
	public LeaveTypeDTO findLeaveType(String id) throws DAOSystemException{
		LeaveTypeDTO currentLeaveType = new LeaveTypeDTO();

			currentLeaveType = leaveTypeDAO.findLeaveType(id);

			return currentLeaveType;

		
	}
    @SuppressWarnings("finally")
	public ArrayList<LeaveTypeDTO> findAllLeaveType() throws DAOSystemException {
    	ArrayList<LeaveTypeDTO> currentList = new ArrayList<LeaveTypeDTO>();
			currentList = leaveTypeDAO.findAllLeaveTypes();

			return currentList;

    }
    public void insertLeaveType(LeaveTypeDTO leaveType) throws DAOSystemException {

			leaveTypeDAO.insertLeaveType(leaveType);

    }
    public void updateLeaveType(LeaveTypeDTO leaveType) throws DAOSystemException {

			leaveTypeDAO.updateLeaveType(leaveType);

    }
    public void deleteLeaveType(LeaveTypeDTO leaveType) throws DAOSystemException {

    		leaveTypeDAO.deleteLeaveType(leaveType);

    }
}
